<template>
  <div class="runBox">
    <el-card class="box_card">
      <div>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item>
            <el-select v-model="formInline.region" placeholder="按状态">
              <el-option label="区域一" value="shanghai"></el-option>
              <el-option label="区域二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="时间段">
            <el-col :span="11">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                v-model="formInline.date1"
                style="width: 100%"
              ></el-date-picker>
            </el-col>
            <el-col class="line" :span="2">-</el-col>
            <el-col :span="11">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                v-model="formInline.date1"
                style="width: 100%"
              ></el-date-picker>
            </el-col>
          </el-form-item>
        </el-form>
        <el-button style="background: #2e71ad; color: #fff" @click="search"
          >查询</el-button
        >
        <el-button style="background: #e3e4e8" @click="onSubmit"
          >清空</el-button
        >
        <div class="title">
          <div class="total">
            <div class="money">提现金额:￥2457.00</div>
            <div class="hand">手续费:￥422.00</div>
          </div>

          <div class="text">按时间先后排序</div>
        </div>
        <el-table
          :data="tableData"
          border
          stripe
          style="width: 100%"
          :cell-style="rowStyle"
          :header-cell-style="{ background: '#e4ebed', color: '#606266' }"
        >
          <el-table-column prop="withdrawalId" label="提现编号" align="center">
          </el-table-column>
          <el-table-column label="提现账号" align="center" width="300px">
            <template slot-scope="scope">
              <!-- <p>开户银行：{{ scope.row.withdrawalAccount[0] }}</p>
              <p>开户人姓名：{{ scope.row.withdrawalAccount[1] }}</p>
              <p>银行卡号：{{ scope.row.withdrawalAccount[2] }}</p> -->
              <p>开户银行：{{ scope.row.band }}</p>
              <p>开户人姓名：{{ scope.row.bandname }}</p>
              <p>银行卡号：{{ scope.row.bandaccount }}</p>
            </template>
          </el-table-column>
          <el-table-column prop="account" label="账号" align="center">
          </el-table-column>
          <el-table-column prop="money" label="提现金额" align="center">
          </el-table-column>
          <el-table-column prop="handpay" label="手续费" align="center">
          </el-table-column>
          <el-table-column prop="realpay" label="实际提现金额" align="center">
          </el-table-column>
          <el-table-column prop="time" label="提交时间" align="center">
          </el-table-column>
          <el-table-column prop="status" label="状态" align="center">
            <template slot-scope="scope">
              <span
                v-if="scope.row.status === '待处理'"
                style="color: #da2120"
                >{{ scope.row.status }}</span
              >
              <span v-if="scope.row.status === '已处理'">{{
                scope.row.status
              }}</span>
            </template>
          </el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button
                size="mini"
                v-if="scope.row.status === '待处理'"
                class="handle"
                @click="handleEdit = true"
                >去处理</el-button
              >
              <el-button
                size="mini"
                v-if="scope.row.status === '已处理'"
                class="processed"
                @click="checkClick(scope.row)"
                >查看</el-button
              >
            </template>
          </el-table-column>
        </el-table>
        <div class="bottom">
          <span class="page">共57条，每页10条</span>
          <div class="block">
            <el-pagination
              background
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage4"
              :total="57"
              :page-size="10"
              layout="jumper, prev, pager, next "
            >
            </el-pagination>
          </div>
        </div>
      </div>
    </el-card>

    <!-- 去处理弹框 -->
    <el-dialog
      title="提现处理"
      :visible.sync="handleEdit"
      width="30%"
      class="handleDialog"
    >
      <el-form :model="transfer" label-width="80px">
        <el-form-item label="转账方式">
          <el-radio-group v-model="transfer.type">
            <el-radio label="银行卡转账"></el-radio>
            <el-radio label="微信转账"></el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button class="btn2" @click="handleEdit = false">提交</el-button>
      </span>
    </el-dialog>

    <!-- 查看弹框 -->
    <el-dialog title="处理详情" :visible.sync="check" width="30%">
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="转账时间">
          <span>{{ form.time }}</span>
        </el-form-item>
        <el-form-item label="转账金额">
          <span>{{ form.realpay }}</span>
        </el-form-item>
        <el-form-item label="银行账户">
          <span>{{ form.bandaccount }}</span>
        </el-form-item>
        <el-form-item label="银行">
          <span>{{ form.band }}</span>
        </el-form-item>
        <el-form-item label="账户姓名">
          <span>{{ form.bandname }}</span>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        region: "",
        user: "",
        date1: "",
        date2: "",
      },
      tableData: [
        {
          withdrawalId: "000005",
          withdrawalAccount: ["工商银行", "庄老大", "62176528985454561554"],
          band: "工商银行",
          bandname: "庄老大",
          bandaccount: "62176528985454561554",
          account: "微笑的刺客",
          money: "￥1000.00",
          handpay: "0",
          realpay: "￥1000.00",
          time: "2022-06-01",
          status: "待处理",
        },
        {
          withdrawalId: "000005",
          withdrawalAccount: ["工商银行", "庄老大", "62176528985454561554"],
          band: "工商银行",
          bandname: "庄老大",
          bandaccount: "62176528985454561554",
          account: "微笑的刺客",
          money: "￥1000.00",
          handpay: "0",
          realpay: "￥1000.00",
          time: "2022-06-01",
          status: "待处理",
        },
        {
          withdrawalId: "000005",
          withdrawalAccount: ["工商银行", "庄老大", "62176528985454561554"],
          band: "工商银行",
          bandname: "庄老大",
          bandaccount: "62176528985454561554",
          account: "微笑的刺客",
          money: "￥1000.00",
          handpay: "3.00%",
          realpay: "￥970.00",
          time: "2022-06-01",
          status: "已处理",
        },
        {
          withdrawalId: "000005",
          withdrawalAccount: ["工商银行", "庄老大", "62176528985454561554"],
          band: "工商银行",
          bandname: "庄老大",
          bandaccount: "62176528985454561554",
          account: "微笑的刺客",
          money: "￥1000.00",
          handpay: "3.00%",
          realpay: "￥970.00",
          time: "2022-06-01",
          status: "已处理",
        },
      ],
      form: {},
      transfer: {type:''},
      handleEdit: false,
      check: false,
    };
  },

  mounted() {},

  methods: {
    rowStyle() {
      return "text-align:center";
    },
    handleEdit() {},
    checkClick(row) {
      this.check = true;
      this.form = row;
      // this.form.band = row.withdrawalAccount[0];
      // this.form.bandname = row.withdrawalAccount[1];
      // this.form.bandaccount = row.withdrawalAccount[2];

      console.log(this.form);
    },
  },

  computed: {},
};
</script>

<style lang="scss" scoped>
.runBox {
  height: 100%;
  padding: 30px 20px;
}
.el-card {
  height: 100%;
}
.box_card {
  height: 100%;
  ::v-deep .el-card__body {
    height: 100%;
  }
}
.line {
  display: flex;
  justify-content: center;
}
.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 20px;
  .total {
    display: flex;
    .money {
      width: 170px;
      height: 35px;
      line-height: 35px;
      text-align: center;
      border-radius: 4px;
      background: #c95339;
      color: #fff;
    }
    .hand {
      width: 150px;
      height: 35px;
      margin: 0 10px;
      line-height: 35px;
      text-align: center;
      border-radius: 4px;
      background: #fcad1f;
      color: #fff;
    }
  }

  .text {
    line-height: initial;
    color: #999;
    font-size: 16px;
  }
}
::v-deep .cell {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  flex-direction: column;
  align-content: center;
  p {
    margin: 0;
  }
}
.handle {
  background: #28abbb;
  color: #fff;
}
.processed {
  background: #aababe;
  color: #fff;
}
.bottom {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin: 40px 0px 30px 0px;
  .page {
    font-size: 14px;
    color: #999;
  }
}
.handleDialog {
  ::v-deep .el-dialog__body {
    padding-bottom: 0;
  }
}

::v-deep .el-dialog__footer {
  text-align: center;
  .dialog-footer {
    .btn1 {
      background: #e3e4e8;
      color: #333;
    }
    .btn2 {
      background: #2f72a9;
      color: #fff;
    }
  }
}
</style>